
import {
    CirclePlusFilled,
    Search,
    DeleteFilled,
    Edit,
    WarnTriangleFilled,
    Lock,
    Switch,
    Menu,
    UserFilled,
    Tools,
    User,
    Share 
} from '@element-plus/icons-vue'

import axios from '@/api'




export const initIcon = (stricon) => {
    if (stricon == "CirclePlusFilled") {
        return CirclePlusFilled;
    }
    else if (stricon == "Search") {
        return Search;
    } 
    else if (stricon == "DeleteFilled") {
        return DeleteFilled;
    }
    else if (stricon == "Edit") {
        return Edit;
    } 
    else if (stricon == "WarnTriangleFilled") {
        return WarnTriangleFilled;
    } 
    else if (stricon == "Lock") {
        return Lock;
    }  
    else if (stricon == "Switch") {
        return Switch;
    }  
    else if (stricon == "Menu") {
        return Menu;
    }  
    else if (stricon == "UserFilled") {
        return UserFilled;
    }  
    else if (stricon == "Tools") {
        return Tools;
    }  
    else if (stricon == "User") {
        return User;
    }  
    else if (stricon == "Share") {
        return Share;
    }  
    
    

    
    
    
}

export const iconList = () => {
    return ['CirclePlusFilled', 'Search','DeleteFilled','Edit',
    'WarnTriangleFilled','Lock','Switch','Menu','UserFilled','Tools','User','Share']
}


export const currentMenuPermission = async (menuid) => {
    let reponse = await axios.get(`/Menu/GetCurrentMenuPermission/${menuid}`);
    let { data, success } = reponse.data;
    if (success) { 
        var result = new Array();
        data.forEach(element => {
            result.push(element);
        });
        return result;
    }
    return new Array();
}



//请求后端api接口的url地址 
export const baseURL = () => "http://localhost:5194/";
export const authURL = () => "http://localhost:5236/";
export const apiUrl = () => `${baseURL()}api/`;






